home *** CD-ROM | disk | FTP | other *** search
/ Winzipper / Winzipper_ISO.iso / utilities / comsuite 95 / COMMSUIT / MCIMAIL.C_ / MCIMAIL.C
Encoding:
C/C++ Source or Header  |  1993-11-04  |  2.0 KB  |  64 lines

  1. /* This program mcimail.c created by Delrina and assigned to the mcimail session*/
  2. /* runs an automated logon script for connecting to MCI Mail.                    */
  3.  
  4. /*  $Revision:   1.2  $  */
  5. /*  $Date:   27 Oct 1995 14:42:46  $  */
  6. #include "defines.h"
  7.  
  8.  
  9. /* Define main function, which is always the starting point of C programs. */
  10. /* (The term "void" indicates that the function returns no value.) */
  11. void main()
  12.     {
  13.     /* Declare variables */
  14.     long ScriptHandle;
  15.     int ReturnValue;
  16.     char Buffer[128];
  17.  
  18.     /* Initialize variables */
  19.     ReturnValue = 0;
  20.     ScriptHandle = 0;
  21.  
  22.     /* Establish a link between this script program and Delrina WinComm PRO */
  23.     ScriptHandle = dcInitialize(0,0,0,0);
  24.  
  25.     /* Exit if intialization of link with Delrina WinComm PRO failed */
  26.     if (ScriptHandle == 0) exit();
  27.  
  28.     ReturnValue = -1;
  29.     /* Wait for the user name prompt */
  30.     while (ReturnValue < 0)
  31.         {
  32.         ReturnValue = dcWaitForString(ScriptHandle, 1, " name: ", 3000L);
  33.         if (ReturnValue == DC_ERR_CONECTION_LOST)
  34.             break;
  35.         if (ReturnValue < 0)
  36.             dcTypeText(ScriptHandle, 0, "\r");
  37.         }
  38.  
  39.     /* Get User Name value from Runtime values dialog box */
  40.     if (ReturnValue >= 0)
  41.         ReturnValue = dcGetRuntimeValue(ScriptHandle, 1, 1, 128, Buffer);
  42.  
  43.     /* Type the value */
  44.     if (ReturnValue >= 0)
  45.         ReturnValue = dcTypeText(ScriptHandle, 0, Buffer);
  46.  
  47.     /* Wait for a prompt */
  48.     if (ReturnValue >= 0)
  49.         ReturnValue = dcWaitForString(ScriptHandle, 1, "sword: ", 32000L);
  50.  
  51.     /* Get Password value from Runtime Values dialog box */
  52.     if (ReturnValue >= 0)
  53.         ReturnValue = dcGetRuntimeValue(ScriptHandle, 3, 1, 128, Buffer);
  54.  
  55.     /* Type the value */
  56.     if (ReturnValue >= 0)
  57.         ReturnValue = dcTypeText(ScriptHandle, 0, Buffer);
  58.  
  59.     /* Terminate link between Delrina WinComm PRO and script program */
  60.     dcTerminate(ScriptHandle, 0);
  61.     }
  62.  
  63.  
  64.